﻿#pragma once

#include "../../Server/MirEnvir/Envir.h"
#include <string>
#include <any>

using namespace Server::MirEnvir;


namespace Server
{
    class SystemInfoForm : public System::Windows::Forms::Form
    {
    public:
        virtual ~SystemInfoForm()
        {
            delete components;
            delete tabPage1;
            delete tabControl1;
            delete label4;
            delete label3;
            delete label2;
            delete label1;
            delete MonsterSpawnChanceTextBox;
            delete FishingDelayTextBox;
            delete FishingSuccessRateStartTextBox;
            delete FishingAttemptsTextBox;
            delete label5;
            delete FishingSuccessRateMultiplierTextBox;
            delete FishingMobIndexComboBox;
            delete label6;
            delete groupBox1;
            delete tabPage2;
            delete groupBox2;
            delete MailAutoSendItemsCheckbox;
            delete MailAutoSendGoldCheckbox;
            delete MailFreeWithStampCheckbox;
            delete MailCostPer1kTextBox;
            delete label8;
            delete label7;
            delete MailInsurancePercentageTextBox;
            delete tabPage3;
            delete GoodsOnCheckBox;
            delete GoodsMaxStoredTextBox;
            delete label9;
            delete label10;
            delete GoodsBuyBackTimeTextBox;
            delete GoodsBuyBackMaxStoredTextBox;
            delete label11;
            delete tabPage4;
            delete tabPage5;
            delete label12;
            delete label13;
            delete MarriageCooldown_textbox;
            delete LoverRecall_checkbox;
            delete LoverBonusEXP_textbox;
            delete label14;
            delete RequiredLevel_textbox;
            delete WeaponOnly_checkbox;
            delete BaseChance_textbox;
            delete label15;
            delete RefineTime_textbox;
            delete label16;
            delete NormalStat_textbox;
            delete label17;
            delete WepDimReturn_textbox;
            delete label20;
            delete CritMultiplier_textbox;
            delete label19;
            delete CritChance_textbox;
            delete label18;
            delete ItemDimReturn_textbox;
            delete label21;
            delete RefineCost_textbox;
            delete label22;
            delete OreName_textbox;
            delete label23;
            delete label24;
            delete ReplaceRingCost_textbox;
            delete tabPage6;
            delete label25;
            delete MenteeExpBoost_textbox;
            delete label26;
            delete MentorDamageBoost_textbox;
            delete MentorLevelGap_textbox;
            delete label27;
            delete label28;
            delete MentorLength_textbox;
            delete MenteeSkillBoost_checkbox;
            delete label29;
            delete MenteeExpBank_textbox;
            delete tabPage7;
            delete GemStatCheckBox;
            delete tabPage8;
            delete btnSpawnTickRemove;
            delete btnSpawnTickAdd;
            delete lbSpawnTickList;
            delete panel1;
            delete txtSpawnTickDefault;
            delete toolTip1;
            delete label32;
            delete pnlSpawnTickConfig;
            delete txtSpawnTickSpeed;
            delete txtSpawnTickUsers;
            delete label31;
            delete label30;
            delete lbltickmins;
        }

        Server::MirEnvir::Envir *getEnvir() const;

        bool FishingChanged = false, MailChanged = false, GoodsChanged = false, RefineChanged = false, MarriageChanged = false, MentorChanged = false, GemChanged = false, SpawnChanged = false;

        SystemInfoForm();

        SystemInfoForm(int selectedTab = 0);

        #pragma region Update

    private:
        void UpdateFishing();

        void UpdateMail();

        void UpdateGoods();

        void UpdateMarriage();

        void UpdateMentor();

        void UpdateRefine();
        void UpdateGem();

        void UpdateSpawnTick();
        #pragma endregion

        void SystemInfoForm_FormClosed(std::any sender, FormClosedEventArgs *e);

        #pragma region Fishing

        void FishingAttemptsTextBox_TextChanged(std::any sender, EventArgs *e);

        void FishingSuccessRateStartTextBox_TextChanged(std::any sender, EventArgs *e);

        void FishingDelayTextBox_TextChanged(std::any sender, EventArgs *e);

        void MonsterSpawnChanceTextBox_TextChanged(std::any sender, EventArgs *e);

        void FishingSuccessRateMultiplierTextBox_TextChanged(std::any sender, EventArgs *e);

        void FishingMobIndexComboBox_SelectedIndexChanged(std::any sender, EventArgs *e);

        #pragma endregion

        #pragma region Mail

        void MailAutoSendGoldCheckbox_CheckedChanged(std::any sender, EventArgs *e);

        void MailAutoSendItemsCheckbox_CheckedChanged(std::any sender, EventArgs *e);

        void MailFreeWithStampCheckbox_CheckedChanged(std::any sender, EventArgs *e);

        void MailCostPer1kTextBox_TextChanged(std::any sender, EventArgs *e);

        void MailInsurancePercentageTextBox_TextChanged(std::any sender, EventArgs *e);

        void LoverRecall_checkbox_CheckedChanged(std::any sender, EventArgs *e);

        void LoverBonusEXP_textbox_TextChanged(std::any sender, EventArgs *e);

        void MarriageCooldown_textbox_TextChanged(std::any sender, EventArgs *e);

        void RequiredLevel_textbox_TextChanged(std::any sender, EventArgs *e);

        void SystemInfoForm_Load(std::any sender, EventArgs *e);

        void WeaponOnly_checkbox_CheckedChanged(std::any sender, EventArgs *e);

        void BaseChance_textbox_TextChanged(std::any sender, EventArgs *e);

        void RefineTime_textbox_TextChanged(std::any sender, EventArgs *e);

        void NormalStat_textbox_TextChanged(std::any sender, EventArgs *e);

        void CritChance_textbox_TextChanged(std::any sender, EventArgs *e);

        void CritMultiplier_textbox_TextChanged(std::any sender, EventArgs *e);

        void WepDimReturn_textbox_TextChanged(std::any sender, EventArgs *e);

        void ItemDimReturn_textbox_TextChanged(std::any sender, EventArgs *e);

        void RefineCost_textbox_TextChanged(std::any sender, EventArgs *e);

        void OreName_textbox_TextChanged(std::any sender, EventArgs *e);

        void ReplaceRingCost_textbox_TextChanged(std::any sender, EventArgs *e);

        void MentorLevelGap_textbox_TextChanged(std::any sender, EventArgs *e);

        void MentorLength_textbox_TextChanged(std::any sender, EventArgs *e);

        void MentorDamageBoost_textbox_TextChanged(std::any sender, EventArgs *e);

        void MenteeExpBoost_textbox_TextChanged(std::any sender, EventArgs *e);

        void MenteeExpBank_textbox_TextChanged(std::any sender, EventArgs *e);

        void MenteeSkillBoost_checkbox_CheckedChanged(std::any sender, EventArgs *e);

        #pragma endregion

        #pragma region Goods

        void GoodsOnCheckBox_CheckedChanged(std::any sender, EventArgs *e);

        void GoodsMaxStoredTextBox_TextChanged(std::any sender, EventArgs *e);

        void GoodsBuyBackTimeTextBox_TextChanged(std::any sender, EventArgs *e);

        void GoodsBuyBackMaxStoredTextBox_TextChanged(std::any sender, EventArgs *e);

        #pragma endregion
        #pragma region Gem
        void GemStatCheckBox_CheckedChanged(std::any sender, EventArgs *e);
        #pragma endregion

        void txtSpawnTickDefault_TextChanged(std::any sender, EventArgs *e);

        void btnSpawnTickAdd_Click(std::any sender, EventArgs *e);

        void btnSpawnTickRemove_Click(std::any sender, EventArgs *e);

        void lbSpawnTickList_SelectedIndexChanged(std::any sender, EventArgs *e);

        void txtSpawnTickUsers_TextChanged(std::any sender, EventArgs *e);

        void txtSpawnTickSpeed_TextChanged(std::any sender, EventArgs *e);


        /// <summary>
        /// Required designer variable.
        /// </summary>
        System::ComponentModel::IContainer *components = nullptr;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected:
        void Dispose(bool disposing) override;

        #pragma region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
    private:
        void InitializeComponent();

        #pragma endregion

        System::Windows::Forms::TabPage *tabPage1;
        System::Windows::Forms::TabControl *tabControl1;
        System::Windows::Forms::Label *label4;
        System::Windows::Forms::Label *label3;
        System::Windows::Forms::Label *label2;
        System::Windows::Forms::Label *label1;
        System::Windows::Forms::TextBox *MonsterSpawnChanceTextBox;
        System::Windows::Forms::TextBox *FishingDelayTextBox;
        System::Windows::Forms::TextBox *FishingSuccessRateStartTextBox;
        System::Windows::Forms::TextBox *FishingAttemptsTextBox;
        System::Windows::Forms::Label *label5;
        System::Windows::Forms::TextBox *FishingSuccessRateMultiplierTextBox;
        System::Windows::Forms::ComboBox *FishingMobIndexComboBox;
        System::Windows::Forms::Label *label6;
        System::Windows::Forms::GroupBox *groupBox1;
        System::Windows::Forms::TabPage *tabPage2;
        System::Windows::Forms::GroupBox *groupBox2;
        System::Windows::Forms::CheckBox *MailAutoSendItemsCheckbox;
        System::Windows::Forms::CheckBox *MailAutoSendGoldCheckbox;
        System::Windows::Forms::CheckBox *MailFreeWithStampCheckbox;
        System::Windows::Forms::TextBox *MailCostPer1kTextBox;
        System::Windows::Forms::Label *label8;
        System::Windows::Forms::Label *label7;
        System::Windows::Forms::TextBox *MailInsurancePercentageTextBox;
        System::Windows::Forms::TabPage *tabPage3;
        System::Windows::Forms::CheckBox *GoodsOnCheckBox;
        System::Windows::Forms::TextBox *GoodsMaxStoredTextBox;
        System::Windows::Forms::Label *label9;
        System::Windows::Forms::Label *label10;
        System::Windows::Forms::TextBox *GoodsBuyBackTimeTextBox;
        System::Windows::Forms::TextBox *GoodsBuyBackMaxStoredTextBox;
        System::Windows::Forms::Label *label11;
        System::Windows::Forms::TabPage *tabPage4;
        System::Windows::Forms::TabPage *tabPage5;
        System::Windows::Forms::Label *label12;
        System::Windows::Forms::Label *label13;
        System::Windows::Forms::TextBox *MarriageCooldown_textbox;
        System::Windows::Forms::CheckBox *LoverRecall_checkbox;
        System::Windows::Forms::TextBox *LoverBonusEXP_textbox;
        System::Windows::Forms::Label *label14;
        System::Windows::Forms::TextBox *RequiredLevel_textbox;
        System::Windows::Forms::CheckBox *WeaponOnly_checkbox;
        System::Windows::Forms::TextBox *BaseChance_textbox;
        System::Windows::Forms::Label *label15;
        System::Windows::Forms::TextBox *RefineTime_textbox;
        System::Windows::Forms::Label *label16;
        System::Windows::Forms::TextBox *NormalStat_textbox;
        System::Windows::Forms::Label *label17;
        System::Windows::Forms::TextBox *WepDimReturn_textbox;
        System::Windows::Forms::Label *label20;
        System::Windows::Forms::TextBox *CritMultiplier_textbox;
        System::Windows::Forms::Label *label19;
        System::Windows::Forms::TextBox *CritChance_textbox;
        System::Windows::Forms::Label *label18;
        System::Windows::Forms::TextBox *ItemDimReturn_textbox;
        System::Windows::Forms::Label *label21;
        System::Windows::Forms::TextBox *RefineCost_textbox;
        System::Windows::Forms::Label *label22;
        System::Windows::Forms::TextBox *OreName_textbox;
        System::Windows::Forms::Label *label23;
        System::Windows::Forms::Label *label24;
        System::Windows::Forms::TextBox *ReplaceRingCost_textbox;
        System::Windows::Forms::TabPage *tabPage6;
        System::Windows::Forms::Label *label25;
        System::Windows::Forms::TextBox *MenteeExpBoost_textbox;
        System::Windows::Forms::Label *label26;
        System::Windows::Forms::TextBox *MentorDamageBoost_textbox;
        System::Windows::Forms::TextBox *MentorLevelGap_textbox;
        System::Windows::Forms::Label *label27;
        System::Windows::Forms::Label *label28;
        System::Windows::Forms::TextBox *MentorLength_textbox;
        System::Windows::Forms::CheckBox *MenteeSkillBoost_checkbox;
        System::Windows::Forms::Label *label29;
        System::Windows::Forms::TextBox *MenteeExpBank_textbox;
        System::Windows::Forms::TabPage *tabPage7;
        System::Windows::Forms::CheckBox *GemStatCheckBox;
        System::Windows::Forms::TabPage *tabPage8;
        System::Windows::Forms::Button *btnSpawnTickRemove;
        System::Windows::Forms::Button *btnSpawnTickAdd;
        System::Windows::Forms::ListBox *lbSpawnTickList;
        System::Windows::Forms::Panel *panel1;
        System::Windows::Forms::TextBox *txtSpawnTickDefault;
        System::Windows::Forms::ToolTip *toolTip1;
        System::Windows::Forms::Label *label32;
        System::Windows::Forms::Panel *pnlSpawnTickConfig;
        System::Windows::Forms::TextBox *txtSpawnTickSpeed;
        System::Windows::Forms::TextBox *txtSpawnTickUsers;
        System::Windows::Forms::Label *label31;
        System::Windows::Forms::Label *label30;
        System::Windows::Forms::Label *lbltickmins;
    };
}
